﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Common;
using AspNetCs.Bll;
using AspNetCs.Model;

public partial class step_iframe : System.Web.UI.Page
{
    private AspNetCs.Bll.LoveWallBLL bll = new AspNetCs.Bll.LoveWallBLL();
    private LoveWall_Model model = new LoveWall_Model();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Page.IsPostBack )
        {
            //验证码验证
            if (this.Session["LoginValidateCode"] != null)
            {
                if ((this.txtValidCode.Text.Trim() == "") || txtValidCode.Text.Trim().ToUpper() != this.Session["LoginValidateCode"].ToString().ToUpper())
                {
                    JScript.alert_history("验证码错误", -1);
                }
                else
                {
                    string content = Server.HtmlDecode(Common.Utils.EncodeHtml(Common.RequestHelper.GetFormString("MyMessage")));
                    int IconImg = Common.RequestHelper.GetFormInt("IconImg1", 0);
                    string nick = Common.RequestHelper.GetFormString("nick");
                    int scolor = Common.RequestHelper.GetFormInt("scolor", 0);
                    string recvnick = Common.RequestHelper.GetFormString("recvnick");
                    string IP = Common.RequestHelper.GetIP();
                    model.Author = nick;
                    model.BgColor =scolor;
                    model.BgImg = IconImg;
                    model.Content = content;
                    model.PDate = DateTime.Now;
                    bll.AddLoveWallMsg(model);
                    JScript.AlertAndTopRedirect("提交成功", "Default.aspx");
                }
            }
        }
    }
}
